export class Card {
    suit:string = ''//花色
    rank:number = 0//牌的大小
    constructor(suit:string, rank:number) {
        this.suit = suit
        this.rank = rank
    }
    toString():string//输出时不带啰里啰嗦的大括号逗号什么的
    {
        let new_rank:string = ''
        switch (this.rank) {
            case 14: {
                new_rank = 'A'
                break
            }
            case 11: {
                new_rank = 'J'
                break
            }
            case 12: {
                new_rank = 'Q'
                break
            }
            case 13: {
                new_rank = 'K'
                break
            }
            default:
                {
                    new_rank = this.rank + ''
                    break
                }
        }
        return this.suit + new_rank
    }
}

let card:Card = new Card('红桃',13)
// process.stdout.write(card)//必须打印字符串类型，而非
console.log(card.toString());



